package org.chend.fraud;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/fraud-check")
public record FraudReviewController(FraudReviewService fraudReviewService) {

    @GetMapping("{email}")
    public Boolean isFraudster(@PathVariable("email") String customerEmail) {
        return fraudReviewService.isFraudulentCustomer(customerEmail);
    }
}
